export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: "sf_kpiName",
          title: {
            "zh-CN": "KPI指标名",
            "en-US": "sf_kpiName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "weight",
          title: {
            "zh-CN": "权重",
            "en-US": "weight",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "targetValue",
          title: {
            "zh-CN": "目标值",
            "en-US": "targetValue",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_energyCode",
          title: {
            "zh-CN": "能源编码",
            "en-US": "sf_energyCode",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_energyName",
          title: {
            "zh-CN": "能源名称",
            "en-US": "sf_energyName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.energyCodeOptions, params.row.sf_energyCode))
          },
          config: { type: 'select', options: this.energyCodeOptions, disabled:true }
        },
        {
          key: "sf_energyType",
          title: {
            "zh-CN": "能源类别",
            "en-US": "sf_energyType",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_energyTypeName",
          title: {
            "zh-CN": "能源类别名称",
            "en-US": "sf_energyTypeName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: 'sf_energySource',
          title: {
            'zh-CN': '能源来源',
            'en-US': 'sf_energySource'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.sourceOptions, params.row.sf_energySource))
          },
          config: { type: 'select', options: this.sourceOptions, disabled: true }
        },
        {
          key: "sf_pointName",
          title: {
            "zh-CN": "数采点位",
            "en-US": "sf_pointName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: 'sf_measuringUnit',
          title: {
            'zh-CN': '计量单位',
            'en-US': 'sf_measuringUnit'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true
        },
        {
          key: "sf_scale",
          title: {
            "zh-CN": "统计粒度",
            "en-US": "sf_scale",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.scaleOptions, params.row.sf_scale))
          },
          config: { type: 'select', options: this.scaleOptions, disabled:true }
        },
        {
          key: 'sf_status',
          title: {
            'zh-CN': '状态',
            'en-US': 'sf_status'
          }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          show: true
        },
        {
          key: "createdBy",
          title: {
            "zh-CN": "创建人账号",
            "en-US": "created by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "createTime",
          title: {
            "zh-CN": "创建时间",
            "en-US": "create time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updatedBy",
          title: {
            "zh-CN": "修改人账号",
            "en-US": "updated by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updateTime",
          title: {
            "zh-CN": "修改时间",
            "en-US": "update time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
      ];
    },
    // form中列字段
    formColumns() {
      return [
        {
          key: "sf_kpiName",
          title: {
            "zh-CN": "KPI指标名",
            "en-US": "sf_kpiName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_energyName",
          title: {
            "zh-CN": "能源名称",
            "en-US": "sf_energyName",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: this.energyCodeOptions },
        },
        {
          key: "weight",
          title: {
            "zh-CN": "权重",
            "en-US": "weight",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "targetValue",
          title: {
            "zh-CN": "目标值",
            "en-US": "targetValue",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "number" },
        },
        {
          key: "sf_energyCode",
          title: {
            "zh-CN": "能源编码",
            "en-US": "sf_energyCode",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: ''},
        },
        {
          key: "sf_energyType",
          title: {
            "zh-CN": "能源类别",
            "en-US": "sf_energyType",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "" },
        },
        {
          key: "sf_energyTypeName",
          title: {
            "zh-CN": "能源类别名称",
            "en-US": "sf_energyTypeName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "" },
        },
        {
          key: 'sf_energySource',
          title: {
            'zh-CN': '能源来源',
            'en-US': 'sf_energySource'
          }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          config: { type: 'select', options: this.sourceOptions }
        },
        {
          key: 'sf_measuringUnit',
          title: {
            'zh-CN': '计量单位',
            'en-US': 'sf_measuringUnit'
          }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          config: { type: 'text' }
        },
        {
          key: "sf_pointName",
          title: {
            "zh-CN": "数采点位",
            "en-US": "sf_pointName",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_scale",
          title: {
            "zh-CN": "统计粒度",
            "en-US": "sf_scale",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: 'select', options: this.scaleOptions }
        },
        {
          key: 'sf_status',
          title: {
            'zh-CN': '状态',
            'en-US': 'sf_status'
          }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          config: { type: 'select', options: this.energyStatus }
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "sf_kpiName",
          title: {
            "zh-CN": "KPI指标名",
            "en-US": "sf_kpiName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_energyCode",
          title: {
            "zh-CN": "能源编码",
            "en-US": "sf_energyCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_energyName",
          title: {
            "zh-CN": "能源名称",
            "en-US": "sf_energyName",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "sf_kpiName",
          title: {
            "zh-CN": "KPI指标名",
            "en-US": "sf_kpiName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_energyCode",
          title: {
            "zh-CN": "能源编码",
            "en-US": "sf_energyCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_energyName",
          title: {
            "zh-CN": "能源名称",
            "en-US": "sf_energyName",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    lang() {
      return {
        "en-US": {
          cancel: "cancel",
          confirmDelete: "confirm delete?",
        },
        "zh-CN": {
          cancel: "取消",
          confirmDelete: "确认删除？",
        },
      }[this.G_Locale];
    },
  },
};
